#tag Class
Protected Class medievo
Inherits Application
	#tag Event
		Sub Open()
		  facade = new GameFacade
		  
		  winAIRun.Visible = true
		  
		  #if DebugBuild then
		    testRunner.Visible = true
		    'winMain.Visible = false
		  #else
		    'winMain.Visible = true
		  #endif
		  
		  
		  
		End Sub
	#tag EndEvent


	#tag Method, Flags = &h0
		Function GetGameFacade() As GameFacade
		  return facade
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub RaiseError(errNo as integer, errText as String, mName as string, errLvl as integer)
		  dim msgDlg as new MessageDialog
		  dim b as MessageDialogButton
		  
		  msgdlg.Message = "(" + str(errNo) + ") " + errText
		  msgdlg.Explanation = "Thrown by " + mName
		  msgDlg.Icon = MessageDialog.GraphicCaution
		  msgDlg.ActionButton.Caption = "OK"
		  
		  b = msgDlg.ShowModal
		  
		  //MsgBox "(" + str(errNo) + ") " + errText + " in " + mName
		  
		End Sub
	#tag EndMethod


	#tag Note, Name = Tiles
		The tiles in the project are In order to make the tiles functioning you have to
	#tag EndNote


	#tag Property, Flags = &h21
		Private facade As GameFacade
	#tag EndProperty

	#tag Property, Flags = &h0
		Dbg As String
	#tag EndProperty

	#tag Property, Flags = &h0
		randomAI As Integer = 0
	#tag EndProperty

	#tag Property, Flags = &h0
		decissionAI As Integer = 0
	#tag EndProperty

	#tag Property, Flags = &h0
		highestR As Integer = -1
	#tag EndProperty

	#tag Property, Flags = &h0
		highestD As Integer = -1
	#tag EndProperty

	#tag Property, Flags = &h0
		tie As Integer = 0
	#tag EndProperty


	#tag Constant, Name = kFileQuitShortcut, Type = String, Dynamic = False, Default = \"", Scope = Public
		#Tag Instance, Platform = Mac OS, Language = Default, Definition  = \"Cmd+Q"
		#Tag Instance, Platform = Linux, Language = Default, Definition  = \"Ctrl+Q"
	#tag EndConstant

	#tag Constant, Name = kFileQuit, Type = String, Dynamic = False, Default = \"&Quit", Scope = Public
		#Tag Instance, Platform = Windows, Language = Default, Definition  = \"E&xit"
	#tag EndConstant

	#tag Constant, Name = kEditClear, Type = String, Dynamic = False, Default = \"&Delete", Scope = Public
		#Tag Instance, Platform = Windows, Language = Default, Definition  = \"&Delete"
		#Tag Instance, Platform = Linux, Language = Default, Definition  = \"&Delete"
	#tag EndConstant

	#tag Constant, Name = TILESIZE, Type = Double, Dynamic = False, Default = \"100", Scope = Public
	#tag EndConstant

	#tag Constant, Name = MAXPLAYERS, Type = Double, Dynamic = False, Default = \"5", Scope = Public
	#tag EndConstant


	#tag ViewBehavior
		#tag ViewProperty
			Name="Dbg"
			Group="Behavior"
			Type="String"
			EditorType="MultiLineEditor"
		#tag EndViewProperty
		#tag ViewProperty
			Name="randomAI"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
		#tag EndViewProperty
		#tag ViewProperty
			Name="decissionAI"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
		#tag EndViewProperty
		#tag ViewProperty
			Name="highestR"
			Group="Behavior"
			InitialValue="-1"
			Type="Integer"
		#tag EndViewProperty
		#tag ViewProperty
			Name="highestD"
			Group="Behavior"
			InitialValue="-1"
			Type="Integer"
		#tag EndViewProperty
		#tag ViewProperty
			Name="tie"
			Group="Behavior"
			InitialValue="0"
			Type="Integer"
		#tag EndViewProperty
	#tag EndViewBehavior
End Class
#tag EndClass
